<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<meta name="viewport" content="width=device-width,user-scalable=no,
			initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0" />
	<title>添加雨量信息</title>
	<link href="${pageContext.request.contextPath}/statics/css/bootstrap.css" rel="stylesheet" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/bootstrap.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
	<style>
		h1{
			text-align: center;
			padding-right: 300px;
		}
	</style>
	<script>
        $(function () {
            var districtName = $("#districtName").val();
            if (districtName == null && districtName == ""){
                alert("区域名称不能为空！");
                $("#districtName").focus();
            }
            var monitorTime = $("#monitorTime").val();
            if (monitorTime == null && monitorTime == ""){
                alert("监测时间不能为空！");
                $("#monitorTime").focus();
            }
            $("#monitorTime").blur(function () {
                var monitorTime = $("#monitorTime").val();
                if (monitorTime != null && monitorTime != ""){
                    var  reg =/^(\d{4}).(\d{2}).(\d{2})$/;
                    if(!reg.test(monitorTime))
                    {
                        alert("日期格式不正确！");
                    }
                }
            });

            var rain = $("#rain").val();
            if (rain == null && rain == ""){
                alert("雨量值不能为空！");
                $("#rain").focus();
            }
            var monitoringStation = $("#monitoringStation").val();
            if (monitoringStation == null && monitoringStation == ""){
                alert("监测站不能为空！");
                $("#monitoringStation").focus();
            }

            var monitoringAddress = $("#monitoringAddress").val();
            if (monitoringAddress == null && monitoringAddress == ""){
                alert("站点地址不能为空！");
                $("#districtName").focus();
            }
        });
	</script>
</head>
<body>
<div class="container">
	<h1>新增雨量监测信息</h1>
	<form class="form-horizontal" action="${pageContext.request.contextPath}/rainManage/rainManageaddsave" method="post">
		<div class="form-group">
			<label for="districName" class="col-sm-2 control-label">区域名称</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" id="districName" name="districName">
			</div>
			<span class="col-sm-5"></span>
		</div>
		<div class="form-group">
			<label for="monitortime" class="col-sm-2 control-label">监测时间</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" id="monitortime" name="monitortime">
			</div>
			<span class="col-sm-5">yyyy.MM.dd格式</span>
		</div>
		<div class="form-group">
			<label for="rain" class="col-sm-2 control-label">雨量值(mm)</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" id="rain" name="rain">
			</div>
			<span class="col-sm-5"></span>
		</div>
		<div class="form-group">
			<label for="monitoringStation" class="col-sm-2 control-label">监测站</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" id="monitoringStation" name="monitoringStation">
			</div>
			<span class="col-sm-5"></span>
		</div>
		<div class="form-group">
			<label for="monitoringAddress" class="col-sm-2 control-label">站点地址</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" id="monitoringAddress" name="monitoringAddress">
			</div>
			<span class="col-sm-5"></span>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<input type="submit" class="btn btn-default" value="保存" />
				<input type="reset" class="btn btn-default" value="重置"/>
				<button type="button" onclick="javascript:history.back();" class="btn btn-default">返回</button>
			</div>
		</div>
	</form>
</div>
</body>
</html>